/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package safemedicalsolution;

/**
 *
 * @author Saad
 */

import java.io.File;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SysDirWatcher implements Runnable {
    
    Logger log = LoggerFactory.getLogger("Activity");
    
    @Override
    public void run() {
        try{
            String incomingSMSPath = "C:/Users/Saad/Documents/NetBeansProjects/SafeMedicalSolution/logs";
            while(true){
                java.io.File f = new File(incomingSMSPath);
                
                String[] filenames = f.list();
                
                for(int i=0; i < filenames.length; i++){
                    log.debug(filenames[i]);                    
                }
                
                Thread.sleep(5000);
            }
        }
        catch(Exception ex)
        {
            log.error(ex.getMessage(),ex);            
        }
    }
    
    
}
